package com.qiaofang.applet.service.property.service.dto;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.apache.commons.lang3.StringUtils;

import java.math.BigDecimal;

/**
 * @author QF2019
 */
@Data
@ApiModel("小区添加房源列表DTO,提供给后台管理系统使用")
@NoArgsConstructor
@AllArgsConstructor
@Builder
public class EstatePropertyListDto {

    @ApiModelProperty("房源唯一UUID")
    private String propertyUniqueUuid;

    @ApiModelProperty("房源编号")
    private String propertyNo;

    @ApiModelProperty("户型")
    private String houseType;

    @ApiModelProperty("售价")
    private BigDecimal price;

    @ApiModelProperty("交易类型,租、售、租或售")
    private String tradeType;

    @ApiModelProperty("归属员工1Uuid")
    private String employeeUuid1;

    @ApiModelProperty("归属员工1名称")
    private String employeeUuid1Name;

    @ApiModelProperty("归属人部门")
    private String deptName1;

    @ApiModelProperty(value = "房")
    private Integer countF;
    @ApiModelProperty(value = "厅", hidden = true)
    private Integer countT;
    @ApiModelProperty(value = "卫", hidden = true)
    private Integer countW;

    public String getHouseType() {
        StringBuffer sb = new StringBuffer();
        sb.append(getCountF() == null ? "0" : getCountF()).append("室")
                .append((getCountT() == null ? "0" : getCountT()) + "厅")
                .append((getCountW() == null ? "0" : getCountW()) + "卫");

        return sb.toString();
    }
}
